<?php

namespace app\index\controller;

use think\Controller;
use think\Db;
use think\facade\Session;
use think\Request;
use Firebase\JWT\JWT;
use Firebase\JWT\SignatureInvalidException;
class Account extends Controller
{

    public function index()
    {
        $a = Session::get("user");
        $bb = Db::name('user')->where('id',$a['id'])->select();
        $aa =Db::name('details')->where('u_id',$a['id'])->select();
        $b[0]=$bb;
        $b[1]=$aa;
        return $b;
    }


    public function create()
    {
        return[__CLASS__,__FUNCTION__];
    }


    public function save()
    {
        $user = new \app\index\model\Account();
        try {
            $user->tixian();
            return ['status' => true,'error'=>'提现成功!'];
        } catch (\Exception $e) {
            return ['status' => false, 'error' => $e->getMessage()];
        }
    }


    public function read($id)
    {
        return[__CLASS__,__FUNCTION__];
    }


    public function edit($id)
    {
        return[__CLASS__,__FUNCTION__];
    }


    public function update()
    {
        $user = new \app\index\model\Account();
        try {
            $user->chongzhi();
            return ['status' => true,'error'=>'充值成功!'];
        } catch (\Exception $e) {
            return ['status' => false, 'error' => $e->getMessage()];
        }
    }

    public function delete($id)
    {
        return[__CLASS__,__FUNCTION__];
    }
}
